const bcrypt = require('bcryptjs')
const salt = 10;

//将原始密码转成hash密码
function hash(value){
    return bcrypt.hashSync(value, salt);
}

//将原始密码和hash密码进行比较
function compare(value, hash){
    return bcrypt.compareSync(value, hash);
}

module.exports = {
    hash,
    compare
}